package com.naiterui.ehp.bs.esign.entity.mysql;

import lombok.Builder;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * @author guoyongxiang
 * @date 2019/12/2 20:05
 * @since 1.0.0
 */
@Builder
@Data
@Table(name = "esign_presign_file")
@Entity
public class EsignPresignFile {

    /**
     * 文件类型-医生处方 {@value}
     */
    public final static int TYPE_RECIPEL_DR = 1;
    /**
     * 文件类型-药师处方 {@value}
     */
    public final static int TYPE_RECIPEL_PH = 2;
    /**
     * 文件类型-医生病例 {@value}
     */
    public final static int TYPE_EMR_DR = 3;
    /**
     * 文件类型-医生免密 {@value}
     */
    public final static int TYPE_NO_SECRET_DR = 4;
    /**
     * 文件类型-药师免密 {@value}
     */
    public final static int TYPE_NO_SECRET_PH = 5;
    /**
     * 文件类型-调配药师处方 {@value}
     */
    public final static int TYPE_RECIPEL_AL_PH = 6;
    /**
     * 会诊-受邀专家
     */
    public final static int TYPE_GROUPCONSULT_TARGET = 7;
    /**
     * 会诊-发起医师
     */
    public final static int TYPE_GROUPCONSULT_SOURCE = 8;

    @Id
    @Column(name = "id", unique = true, nullable = false)
    @GeneratedValue(strategy = IDENTITY)
    private Long id;

    /**
     * 文件类型(1:医生处方, 2:药师处方, 3:医生病例, 4:医生免密, 5:医师免密)
     */
    @Column(name = "type")
    private Integer type;

    /**
     * 三方文件唯一标识
     */
    @Column(name = "unique_id")
    private String uniqueId;

    /**
     * 内部文件编号
     */
    @Column(name = "file_sn")
    private String fileSn;

    /**
     * 签名前文件相对路径
     */
    @Column(name = "path")
    private String path;

    /**
     * 签名后文件相对路径
     */
    @Column(name = "sign_path")
    private String signPath;

    /**
     * 创建时间
     */
    @Column(name = "created_at")
    private Date createdAt;

    /**
     * 修改时间
     */
    @Column(name = "changed_at")
    private Date changedAt;
}
